# test that @need is redefined, and evenheading is kept ans leads to
# an error message.

$misc_command{'need'}->{'keep'} = 1;
$misc_command{'evenheading'}->{'keep'} = 1;

$unknown = \&t2h_redefine_need_unknown;

sub t2h_redefine_need_unknown($$$)
{
   my $command = shift;
   my $line = shift;
   my $pass = shift;

   my ($result_line, $result, $result_text, $message);

   if ($command eq 'need' and $pass == 2)
   {
       my $arg = '';
       if (($line =~ s/^\s+([0-9]+(\.[0-9]*)?)//) or ($line =~ s/\s+(\.[0-9]+)//))
       {
           $arg = $1;
           $line =~ s/^\s+//; 
           $message = "$command has the right arg: $arg\n";
       }
       else
       {
           $message = "Bad arg for $command\n";
       }
       $result_text = &$comment("$command: $arg");
       return ($line, 1, $result_text, $message);
   } 

   return ($line, 0, undef, undef);
}
